/****** Object:  Stored Procedure [dbo].[v_DoanhThuSanPham] Script Date: 6/12/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].v_KhachHangThanhToan') AND OBJECTPROPERTY(id, N'IsView') = 1)
	DROP VIEW [dbo].[v_KhachHangThanhToan]
Go

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		04/07/2012	SongTM					Innit created
*******************************************************************************/

create view v_KhachHangThanhToan
as
	select MaCTPX, ISNULL(SUM(SoTien),0) as ThanhToan
	from tbl_ThanhToan
	group by MaCTPX
go
